package top.sdwu_top.kbase.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.security.core.userdetails.UserDetailsService;
import top.sdwu_top.kbase.common.annocation.CurrentUser;
import top.sdwu_top.kbase.dto.ChangePasswordDto;
import top.sdwu_top.kbase.dto.KbaseAuthUserDto;
import top.sdwu_top.kbase.entity.KbaseAuthUser;
import com.baomidou.mybatisplus.extension.service.IService;
import top.sdwu_top.kbase.vo.KbaseAuthUserVo;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author zhipeng.duan@nvr-china.com
 * @since 2020-02-20
 */
public interface IKbaseAuthUserService extends IService<KbaseAuthUser> , UserDetailsService {

    boolean save(KbaseAuthUser currentUser, KbaseAuthUser user);

    KbaseAuthUser getBySsn(String ssn);

    KbaseAuthUserDto getCurrentUser(KbaseAuthUser user);

    KbaseAuthUser getManagerByOrgId(String orgId);

    Page<KbaseAuthUserDto> page(KbaseAuthUser user, KbaseAuthUserVo userVo);

    boolean delete(KbaseAuthUser user, String id);

    boolean update(KbaseAuthUser currentUser, KbaseAuthUser user);

    KbaseAuthUserDto getUserById(@CurrentUser KbaseAuthUser user, String id);

    boolean changePassword(KbaseAuthUser user, ChangePasswordDto passwordDto);

    boolean updateNowUser(KbaseAuthUser currentUser, KbaseAuthUser user);

}
